<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Đặng Khánh Trung
 * Date: 10/29/12
 * Time: 8:43 PM
 * To change this template use File | Settings | File Templates.
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import Joomla view library
jimport('joomla.application.component.view');

/**
 * Vast View
 */
class VastViewVast extends JView
{
    /**
     * Vast view display method
     * @return void
     */
    function display($tpl = null)
    {
        // Get data from the model
        $items = $this->get('Items');
        $pagination = $this->get('Pagination');

        // Check for errors.
        if (count($errors = $this->get('Errors')))
        {
            JError::raiseError(500, implode('<br />', $errors));
            return false;
        }
        // Assign data to the view
        $this->items = $items;
        $this->pagination = $pagination;

        JToolBarHelper::title(JText::_('COM_VAST_MANAGER'), 'head vm_store_48');
        if (JFactory::getUser()->authorise('core.admin', 'com_vast'))
        {
            JToolBarHelper::preferences('com_vast', '550', '875', 'COM_VAST_JTOOLBAR_OPTIONS');        
        }
        
        // Display the template
        parent::display($tpl);
    }
}
